//
//  StagingSubObj.m
//  sr01sdkProject
//
//  Created by Linktop on 2022/10/19.
//

#import "StagingSubObj.h"
#import "NSDictionary+SleepUsed.h"
@implementation StagingSubObj

+ (NSDictionary *)mj_objectClassInArray
{
    return @{@"list" :  @"StagingListObj", };
}

- (instancetype)initWithDict:(NSDictionary *)dict
{
    self = [super init];
    if (self) {
        self.type = [dict.first intValue];
        NSMutableArray <NSDictionary *> * dictList = dict.second;
        // StagingListObj
        self.list = [NSMutableArray arrayWithCapacity:dictList.count];
        [dictList enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            StagingListObj *listObj =  [[StagingListObj alloc]init];
            listObj.time = obj.first;
            listObj.hr = obj.second;
            listObj.motion = obj.third;
            self.list[idx] = listObj;
        }];
    }
    return self;
}


@end
